import request from '@/utils/request'

// 获取组织架构的数据
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

// 根据id删除部门
export const reqDelDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 添加子部门
export const reqAddDepartment = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 根据id获取部门详情
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

//  编辑部门

export function reqUpdateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
